<form action="{:url()}" method="post" class="form_single">
    <div class="box">
      <div class="box-body">
        <div class="row">
          <div class="col-md-6">
            <div class="form-group">
              <label>产品</label>
              <span>（选择要设置价格的产品）</span>
              <select class="form-control" name="product_id">
                <option value="">请选择产品</option>
                {volist name="products" id="product"}
                <option value="{$product.id}" {if condition="($info.product_id ?? '') == $product.id"}selected{/if}>{$product.name}</option>
                {/volist}
              </select>
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group">
              <label>原价</label>
              <span>（产品的原始价格）</span>
              <input class="form-control" name="original_price" placeholder="请输入原价" value="{$info['original_price']|default=''}" type="number" step="0.01">
            </div>
          </div>
 
          <div class="col-md-6">
            <div class="form-group">
              <label>现价</label>
              <span>（产品的当前价格）</span>
              <input class="form-control" name="current_price" placeholder="请输入现价" value="{$info['current_price']|default=''}" type="number" step="0.01">
            </div>
          </div>
 
          <div class="col-md-6">
            <div class="form-group">
              <label>折扣</label>
              <span>（折扣百分比）</span>
              <input class="form-control" name="discount" placeholder="请输入折扣" value="{$info['discount']|default=100}" type="number" step="0.01">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>生效时间</label>
              <span>（价格生效的时间）</span>
              <input class="form-control" name="effective_time" placeholder="请选择生效时间" value="{$info['effective_time']|default=''}" type="datetime-local">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>状态</label>
              <span>（价格状态）</span>
              <select class="form-control" name="status">
                <option value="1" {if condition="($info.status ?? 1) == 1"}selected{/if}>启用</option>
                <option value="0" {if condition="($info.status ?? 1) == 0"}selected{/if}>禁用</option>
              </select>
            </div>
          </div>

          <div class="col-md-12">
            <div class="form-group">
              <label>备注</label>
              <span>（价格变动的备注说明）</span>
              <textarea class="form-control" name="remark" rows="3" placeholder="请输入备注">{$info['remark']|default=''}</textarea>
            </div>
          </div>
            
        </div>
      </div>
      <div class="box-footer">
        
        <input type="hidden" name="id" value="{$info['id']|default='0'}"/>
          
        {include file="layout/edit_btn_group"/}
        
      </div>
    </div>
</form>

<script>
$(function() {
    // 设置下拉菜单默认值
    ob.setValue("status", {$info.status ?? 1});
});
</script>